#include "../include/workerManager.h"
int main() {

  // 和数据库连接
  MysqlManagement MM;
  MM.connectDB();

  WorkerManager WM;
  char choice;

  while (1) {
    system("clear");
    WM.showMenu();
    cout << "请输入你的的选择：";

    cin >> choice;

    switch (choice) {
    // 增加职工信息
    case '1':
      WM.addWorker(MM);
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    case '2':
      WM.showWorker(MM);
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    case '3':
      WM.deleteWorker(MM);
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    case '4':
      WM.alterWorker(MM);
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();

      break;
    case '5':
      WM.searchWorker(MM);
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    case '6':
      WM.sortWorker(MM);
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    case '7':
      WM.clearWorker(MM);
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    case '0':
      WM.exitSystem();
      cout << "按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    default:
      cout << "输入错误！按空格键继续..." << endl;
      getchar();
      getchar();
      break;
    }
  }

  pause();
  return 0;
}
